﻿using System.Net;
using Microsoft.Office.Interop.Excel;
using MingleReport;

namespace MingleReportingExcelAddIn
{
    public class MingleSession : IMingleSession
    {
        private readonly Application application;

        public MingleSession(Application application)
        {
            this.application = application;
        }

        public Workbook CurrentWorkbook
        {
            get { return application.Workbooks[1]; }
        }

        public CookieContainer LoginCookie
        {
            get { return UserSettings.LoginCookie; }
            set { UserSettings.LoginCookie = value; }
        }

        public string ServerUrl
        {
            get { return UserSettings.MingleServerUrl; }
            set { UserSettings.MingleServerUrl = value; }
        }

        public string ProjectId
        {
            get { return UserSettings.Project; }
            set { UserSettings.Project = value; }
        }
    }
}